import java.util.Scanner;

public class Program14 {
    public static void main(String[] args) {
        //利用scnner类库获取键盘输入
        Scanner console = new Scanner(System.in);
        //提示信息用于规范化输入数据格式
        System.out.print("请输入日期(格式为xxxx-xx-xx)：");
        String date = console.nextLine();
        int year,month,day;
        //利用substring()方法截取字符串然后利用Integer.parseInt()方法将日期信息转化为整型数据储存
        year = Integer.parseInt(date.substring(0,4));
        month = Integer.parseInt(date.substring(5,7));
        day = Integer.parseInt(date.substring(8,10));
        //利用for+switch双循环来加算天数
        for (int i = 1; i < month; i++) {
            switch (i){
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    day += 31;
                    break;
                case 4:
                case 6:
                case 9:
                case 11:
                    day += 30;
                    break;
                case 2:
                    if (year%4 == 0 && year%100 !=0 || year %400 == 0){
                        day += 29;
                    }else {day += 28;}
            }
        }
        //输出结果
        System.out.println("这一天是这一年得第"+day+"天");
    }
}